#encoding: utf-8
'''
Created on 2012-4-9

@author: huangjacky
@copyright: TeamV - Group: WhutOJ
这个模块主要存放一些比较常用的函数
'''

def hexchar2int(c):
    d = ord(c)
    if d > 47 and d < 58:
        return d - 48
    elif d > 64 and d < 71:
        return d - 65 + 10
    elif d > 96 and d < 103:
        return d - 97 + 10 
    else:
        return -1
